using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.CommerceServer.Runtime;

namespace CompanyName.Project.MusicDownloads
{
    [CommerceEvent("MusicDownload")]
    public class MusicDownloadEvent : BaseCommerceEvent
    {
        #region Members
        string _title;
        string _artist;
        string _album;      
        #endregion

        /// <summary>
        /// Default Constructor
        /// </summary>
        public MusicDownloadEvent()
            : base()
        {

        }

        public MusicDownloadEvent(string title, string artist, string album)
        {
            _title = title;
            _artist = artist;
            _album = album;

        }

        [CommerceEventMember("Artist")]
        public string Artist
        {
            get { return _artist; }
            set { _artist = value; }
        }

        [CommerceEventMember("Album")]
        public string Album
        {
            get { return _album; }
            set { _album = value; }
        }

        [CommerceEventMember("Title")]
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        /// <summary>
        /// Validates that this is a valid Event
        /// </summary>
        /// <returns></returns>
        public override bool Validate()
        {
            if (string.IsNullOrEmpty(_title) ||
                string.IsNullOrEmpty(_artist) ||
                string.IsNullOrEmpty(_album))
            {
                return false;
            }
            return base.Validate();
        }

    }
}
